function getcook(key){
    var sy=document.cookie
    var arr=sy.split('; ')
    for(var i=0;i<arr.length;i++){
        var zhong=arr[i].split('=')
        if(zhong[0]==key){
            return zhong[1]
        }
    }
}

function setcook(key,val,expires){
    if(expires){
        var time=new Date()
        time.setTime(time.getTime()-8*60*60*1000+(expires*1000*60*60*24))
        document.cookie=`${key}=${val};expires=${time}`
    }else{
        document.cookie=key+'='+val;
    }
}
function removecook(key){
    setcook(key,1,-1)
}